process.env.VUE_APP_NAME = require('./package.json').name
process.env.VUE_APP_VERSION = require('./package.json').version
process.env.VUE_APP_DESCRIPTION = require('./package.json').description
process.env.VUE_APP_PROJECTID = require('./package.json').projectId
process.env.VUE_APP_PROJECTNAME = require('./package.json').projectName
process.env.VUE_APP_DIRNAME = __dirname
const CompressionPlugin = require("compression-webpack-plugin")
module.exports = {
    lintOnSave: false,
    publicPath: '',
    productionSourceMap: false,
    // configureWebpack: config => {
    //     // 生产环境取消 console.log
    //     if (process.env.NODE_ENV === 'production') {
    //         config.optimization.minimizer[0].options.terserOptions.compress.drop_console = true;
    //         // config.plugin('compressionPlugin').use(new CompressionPlugin({
    //         //     test: /\.(js|css|less)$/, // 匹配文件名
    //         //     threshold: 10240, // 对超过10k的数据压缩
    //         //     minRatio: 0.8,
    //         //     deleteOriginalAssets: true // 删除源文件
    //         // }))
    //     }
    //
    // }
    //
    configureWebpack: {
        module: {
            rules: [
                {
                    test: /\.mjs$/,
                    include: /node_modules/,
                    type: "javascript/auto"
                },
                {
                    test: /\.(eot|svg|ttf|woff|woff2)(\?\S*)?$/,
                    loader: 'file-loader'
                }
            ]
        }
    },
}
